<script setup>
import { useRoute } from 'vue-router'
import { useGlobalStore } from '@/stores/globalStore'

const route = useRoute()

const globalStore = useGlobalStore()

const isLeftScreenShow = computed(() => {
  if (route.path.includes('discuss')) {
    return (
      !(route.matched.length > 3) || globalStore.postDetailMode === 'split screen' || globalStore.viewMode === 'gallery'
    )
  }

  return (
    !(route.matched.length > 2) || globalStore.postDetailMode === 'split screen' || globalStore.viewMode === 'gallery'
  )
})
</script>

<template>
  <slot v-if="isLeftScreenShow" />
  <div class="h-full" v-else>
    <router-view />
  </div>
</template>
